from torch.utils.tensorboard import SummaryWriter
#tensorboard --logdir=./logs --port=6007
from PIL import Image
import numpy as np

writer = SummaryWriter("logs")
# for i in range(100):
#     j = 2*i+5
#     writer.add_scalar("示例y=2x+5",j,i)

image_path = "train/ants/0013035.jpg"
img_PIL = Image.open(image_path)
img_array = np.array(img_PIL)
writer.add_image("test",img_array,1,dataformats="HWC")
writer.close()